<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('报工明细列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="select-form">
                    <div class="select-list">
                        <ul>
                            <li>
                                报工类型：<select name="STTM009">
                                <option value="">所有</option>
                                <option value="3">厦门生产</option>
                                <option value="1">厦门售后</option>
                                <option value="4">成都生产</option>
                                <option value="2">成都售后</option>
                                <option value="5">LED</option>
                            </select>
                            </li>

                            <li>
                                审批人：<select name="STTM008">
                                <option value="">所有</option>
                                <!--<option value="wc">吴灿</option>-->
                                <option value="FengKaiFu">冯开福</option>
                                <option value="YangQingYi">杨清溢</option>
                                <option value="HuangHuiMing">黄辉明</option>
                                <option value="WangShiYong">王士勇</option>
                                <option value="LiWeiMao">李维茂</option>
                                <option value="CaiZhaiJia">蔡寨家</option>
                            </select>
                            </li>

                            <!--<li class="select-selectpicker">
                                <label>审批人： </label>
                            <select  name="STTM008" class="selectpicker" data-none-selected-text="请选择" multiple>
                                <option value="">所有</option>
                                &lt;!&ndash;<option value="wc">吴灿</option>&ndash;&gt;
                                <option value="FengKaiFu">冯开福</option>
                                <option value="YangQingYi">杨清溢</option>
                                <option value="HuangHuiMing">黄辉明</option>
                                <option value="WangShiYong">王士勇</option>
                                <option value="LiWeiMao">李维茂</option>
                                <option value="CaiZhaiJia">蔡寨家</option>
                            </select>
                            </li>-->

                            <li>
                                审批状态：<select name="STTM007">
                                <option value="">所有</option>
                                <option value="1" selected>未审核</option>
                                <option value="2">已驳回</option>
                                <option value="3">已审核</option>
                            </select>
                            </li>
                            <li class="select-time">
                                <label>报工日期： </label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="STTM005S"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="STTM005E"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:sttm:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:sttm:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:sttm:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>-->
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:sttm:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-select-js" />
    <th:block th:include="include :: jquery-cxselect-js" />
    <script th:inline="javascript">
        // 修改字典
        var editFlag = [[${@permission.hasPermi('system:sttm:edit')}]];
        // 删除字典
        var removeFlag = [[${@permission.hasPermi('system:sttm:remove')}]];
        // 审批状态字典
        var sttmStateDatas = [[${@dict.getType('sys_sttm_state')}]];
        // 报工类型字典
        var sttmStateTypeDatas = [[${@dict.getType('sys_sttm_type_state')}]];
        // 设置默认前缀
        var prefix = ctx + "system/sttm";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "报工明细",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'sttmdocno',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'sttm001',
                    title: '姓名'
                },
                {
                    field: 'sttm002',
                    title: '项目号'
                },
                {
                    field: 'sttm013',
                    title: '项目信息'
                },
                    {
                        field: 'sttm009',
                        title: '报工类型',
                        formatter: function (value, row, index) {
                            return $.table.selectDictLabel(sttmStateTypeDatas, value);
                        }
                    },
                {
                    field: 'sttm004',
                    title: '报工时长'
                },
                {
                    field: 'sttm005',
                    title: '报工日期'
                },
                {
                    field: 'sttm006',
                    title: '操作时间'
                },
                    {
                        field: 'sttm007',
                        title: '审批状态',
                        formatter: function (value, row, index) {
                            return $.table.selectDictLabel(sttmStateDatas, value);
                        }
                    },
                {
                    field: 'sttm008',
                    title: '审批人id',
                    visible: false
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.sttmdocno + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.STTMDOCNO + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>